package com.fz.Util;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

/**
 * Created by lenovo on 2017/6/17.
 */
public class mybatisUtil {

 private  SqlSessionFactory sf;
 private  SqlSession session;

    public  void  mybatisUtil() throws IOException {
        String resources="mubatis-conf.xml";
        InputStream inputStream = Resources.getResourceAsStream(resources);
        this.sf = new  SqlSessionFactoryBuilder().build(inputStream);
        this.session = sf.openSession();
    }

}
